package com.itheima.nacos.controller;

import com.itheima.nacos.client.ProviderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

    //动态代理对象,内部远程调用服务生产者的API
    @Autowired
    ProviderClient providerClient;

    @GetMapping("consumerservice")
    public String consumerservice(){
        //远程调用服务生产者的API
        String serviceMessage = providerClient.service();
        return "consumer invoke" + "|" +  serviceMessage;
    }

}
